﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Yoda.Classes
{
	public class Result
	{
		public Boolean? LastPoint;

		public int FirstDoublesGame { get; set; }

		public int SecondDoublesGame { get; set; }

		public string FirstDoublesPoint { get; set; }

		public string SecondDoublesPoint { get; set; }

	
		public string SetResult
		{
			get
			{
				return String.Format("{0}:{1}", this.FirstDoublesGame, this.SecondDoublesGame);
			}
		}


		public string GameResult
		{
			get 
			{
				return String.Format("{0}:{1}", this.FirstDoublesPoint, this.SecondDoublesPoint);
			}
		}

		public bool Finished { get; set; }

		/// <summary>
		/// Gets the difference in games
		/// </summary>
		/// <value>The game difference.</value>
		public int GameDifference
		{
			get 
			{
				return Math.Abs(this.FirstDoublesGame - this.SecondDoublesGame);
			}
		}

		/// <summary>
		/// Gets a value indicating whether this instance is in tie break.
		/// </summary>
		/// <value>
		/// 	<c>true</c> if this instance is in tie break; otherwise, <c>false</c>.
		/// </value>
		public bool IsInTieBreak
		{
			get
			{
				return (this.FirstDoublesGame==6) &&  (this.SecondDoublesGame==6);
			}
		}
	}
}
